// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_BOM_ITEM
// * CreateDate    : 2014-06-05 18:29:39
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:29:39
// * LastChanger   : 2014-06-05 18:29:39
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class BomItemEntity : EntityBase
    {
        public BomItemTable TableSchema
        {
            get
            {
                return BomItemTable.Current;
            }
		}
		
		public BomItemEntity()
        {

        }
		
		public BomItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.BomMasterId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_MASTER_ID"]));
			this.ParentId = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_ID"]));
			this.Version = Convert.ToString(CommonFunctions.ToObject(dr["VERSION"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.BpId = Convert.ToString(CommonFunctions.ToObject(dr["BP_ID"]));
			this.ItemType = Convert.ToString(CommonFunctions.ToObject(dr["ITEM_TYPE"]));
			this.Seqence = Convert.ToInt32(CommonFunctions.ToObject(dr["SEQENCE"]));
			this.UnitDose = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_DOSE"]));
			this.LossRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["LOSS_RATE"]));
			this.ConstantScrap = Convert.ToDecimal(CommonFunctions.ToObject(dr["CONSTANT_SCRAP"]));
			this.EffectiveDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["EFFECTIVE_DATE"]));
			this.ExpirationDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["EXPIRATION_DATE"]));
			this.PickingProductTechnicId = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_PRODUCT_TECHNIC_ID"]));
			this.IsCustomerFor = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_CUSTOMER_FOR"]));
			this.SupplierId = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_ID"]));
			this.StartLots = Convert.ToString(CommonFunctions.ToObject(dr["START_LOTS"]));
			this.EndLots = Convert.ToString(CommonFunctions.ToObject(dr["END_LOTS"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.MtrlId = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_ID"]));
			this.PickingModel = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_MODEL"]));
			this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
			this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
			this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
			this.ManufacturingType = Convert.ToString(CommonFunctions.ToObject(dr["MANUFACTURING_TYPE"]));
			this.LogicNo = Convert.ToString(CommonFunctions.ToObject(dr["LOGIC_NO"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
        }
		
		public BomItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.BomMasterId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_MASTER_ID"]));
			this.ParentId = Convert.ToString(CommonFunctions.ToObject(dr["PARENT_ID"]));
			this.Version = Convert.ToString(CommonFunctions.ToObject(dr["VERSION"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.BpId = Convert.ToString(CommonFunctions.ToObject(dr["BP_ID"]));
			this.ItemType = Convert.ToString(CommonFunctions.ToObject(dr["ITEM_TYPE"]));
			this.Seqence = Convert.ToInt32(CommonFunctions.ToObject(dr["SEQENCE"]));
			this.UnitDose = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_DOSE"]));
			this.LossRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["LOSS_RATE"]));
			this.ConstantScrap = Convert.ToDecimal(CommonFunctions.ToObject(dr["CONSTANT_SCRAP"]));
			this.EffectiveDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["EFFECTIVE_DATE"]));
			this.ExpirationDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["EXPIRATION_DATE"]));
			this.PickingProductTechnicId = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_PRODUCT_TECHNIC_ID"]));
			this.IsCustomerFor = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_CUSTOMER_FOR"]));
			this.SupplierId = Convert.ToString(CommonFunctions.ToObject(dr["SUPPLIER_ID"]));
			this.StartLots = Convert.ToString(CommonFunctions.ToObject(dr["START_LOTS"]));
			this.EndLots = Convert.ToString(CommonFunctions.ToObject(dr["END_LOTS"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.MtrlId = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_ID"]));
			this.PickingModel = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_MODEL"]));
			this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
			this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
			this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
			this.ManufacturingType = Convert.ToString(CommonFunctions.ToObject(dr["MANUFACTURING_TYPE"]));
			this.LogicNo = Convert.ToString(CommonFunctions.ToObject(dr["LOGIC_NO"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return BomItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(BomItemTable.C_ID)); }
            set { SetData(BomItemTable.C_ID, value); }
        }
		
        [DataMember]
        public string BomMasterId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_BOM_MASTER_ID)); }
            set { SetData(BomItemTable.C_BOM_MASTER_ID, value); }
        }
		
        [DataMember]
        public string ParentId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_PARENT_ID)); }
            set { SetData(BomItemTable.C_PARENT_ID, value); }
        }
		
        [DataMember]
        public string Version
        {
            get { return Convert.ToString(GetData(BomItemTable.C_VERSION)); }
            set { SetData(BomItemTable.C_VERSION, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_PRODUCT_ID)); }
            set { SetData(BomItemTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public string BpId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_BP_ID)); }
            set { SetData(BomItemTable.C_BP_ID, value); }
        }
		
        [DataMember]
        public string ItemType
        {
            get { return Convert.ToString(GetData(BomItemTable.C_ITEM_TYPE)); }
            set { SetData(BomItemTable.C_ITEM_TYPE, value); }
        }
		
        [DataMember]
        public int Seqence
        {
            get { return Convert.ToInt32(GetData(BomItemTable.C_SEQENCE)); }
            set { SetData(BomItemTable.C_SEQENCE, value); }
        }
		
        [DataMember]
        public decimal UnitDose
        {
            get { return Convert.ToDecimal(GetData(BomItemTable.C_UNIT_DOSE)); }
            set { SetData(BomItemTable.C_UNIT_DOSE, value); }
        }
		
        [DataMember]
        public decimal LossRate
        {
            get { return Convert.ToDecimal(GetData(BomItemTable.C_LOSS_RATE)); }
            set { SetData(BomItemTable.C_LOSS_RATE, value); }
        }
		
        [DataMember]
        public decimal ConstantScrap
        {
            get { return Convert.ToDecimal(GetData(BomItemTable.C_CONSTANT_SCRAP)); }
            set { SetData(BomItemTable.C_CONSTANT_SCRAP, value); }
        }
		
        [DataMember]
        public DateTime EffectiveDate
        {
            get { return Convert.ToDateTime(GetData(BomItemTable.C_EFFECTIVE_DATE)); }
            set { SetData(BomItemTable.C_EFFECTIVE_DATE, value); }
        }
		
        [DataMember]
        public DateTime ExpirationDate
        {
            get { return Convert.ToDateTime(GetData(BomItemTable.C_EXPIRATION_DATE)); }
            set { SetData(BomItemTable.C_EXPIRATION_DATE, value); }
        }
		
        [DataMember]
        public string PickingProductTechnicId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_PICKING_PRODUCT_TECHNIC_ID)); }
            set { SetData(BomItemTable.C_PICKING_PRODUCT_TECHNIC_ID, value); }
        }
		
        [DataMember]
        public int IsCustomerFor
        {
            get { return Convert.ToInt32(GetData(BomItemTable.C_IS_CUSTOMER_FOR)); }
            set { SetData(BomItemTable.C_IS_CUSTOMER_FOR, value); }
        }
		
        [DataMember]
        public string SupplierId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_SUPPLIER_ID)); }
            set { SetData(BomItemTable.C_SUPPLIER_ID, value); }
        }
		
        [DataMember]
        public string StartLots
        {
            get { return Convert.ToString(GetData(BomItemTable.C_START_LOTS)); }
            set { SetData(BomItemTable.C_START_LOTS, value); }
        }
		
        [DataMember]
        public string EndLots
        {
            get { return Convert.ToString(GetData(BomItemTable.C_END_LOTS)); }
            set { SetData(BomItemTable.C_END_LOTS, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(BomItemTable.C_REMARK)); }
            set { SetData(BomItemTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string MtrlId
        {
            get { return Convert.ToString(GetData(BomItemTable.C_MTRL_ID)); }
            set { SetData(BomItemTable.C_MTRL_ID, value); }
        }
		
        [DataMember]
        public string PickingModel
        {
            get { return Convert.ToString(GetData(BomItemTable.C_PICKING_MODEL)); }
            set { SetData(BomItemTable.C_PICKING_MODEL, value); }
        }
		
        [DataMember]
        public string NetSize
        {
            get { return Convert.ToString(GetData(BomItemTable.C_NET_SIZE)); }
            set { SetData(BomItemTable.C_NET_SIZE, value); }
        }
		
        [DataMember]
        public string GrossSize
        {
            get { return Convert.ToString(GetData(BomItemTable.C_GROSS_SIZE)); }
            set { SetData(BomItemTable.C_GROSS_SIZE, value); }
        }
		
        [DataMember]
        public decimal UnitWeight
        {
            get { return Convert.ToDecimal(GetData(BomItemTable.C_UNIT_WEIGHT)); }
            set { SetData(BomItemTable.C_UNIT_WEIGHT, value); }
        }
		
        [DataMember]
        public string ManufacturingType
        {
            get { return Convert.ToString(GetData(BomItemTable.C_MANUFACTURING_TYPE)); }
            set { SetData(BomItemTable.C_MANUFACTURING_TYPE, value); }
        }
		
        [DataMember]
        public string LogicNo
        {
            get { return Convert.ToString(GetData(BomItemTable.C_LOGIC_NO)); }
            set { SetData(BomItemTable.C_LOGIC_NO, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(BomItemTable.C_UNIT)); }
            set { SetData(BomItemTable.C_UNIT, value); }
        }
		
		#endregion
	}
	
	
}	

